import request from '@/utils/request'

// 查询售后详情列表
export function listAfter_sales_requests(query) {
  return request({
    url: '/shop/after_sales_requests/list',
    method: 'get',
    params: query
  })
}

// 查询售后详情详细
export function getAfter_sales_requests(id) {
  return request({
    url: '/shop/after_sales_requests/' + id,
    method: 'get'
  })
}

// 新增售后详情
export function addAfter_sales_requests(data) {
  return request({
    url: '/shop/after_sales_requests',
    method: 'post',
    data: data
  })
}

// 修改售后详情
export function updateAfter_sales_requests(data) {
  return request({
    url: '/shop/after_sales_requests',
    method: 'put',
    data: data
  })
}

// 删除售后详情
export function delAfter_sales_requests(id) {
  return request({
    url: '/shop/after_sales_requests/' + id,
    method: 'delete'
  })
}
//同意售后
export function agree_requests(data) {
  console.log(data)
  return request({
    url: '/shop/after_sales_requests/agree',
    method: 'put',
    data: data
  })
}
//拒绝售后
export function refuse_requests(id) {
  return request({
    url: '/shop/after_sales_requests/refuse/'+id,
    method: 'post'
  })
}

